package com.example.csdn.mapper;

import com.example.csdn.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserManageMapper {

    List<User> userManageList(String identity);

    @Insert("insert into user(username,password,create_time,identity,status,userDes)" +
            "values (#{username},#{password},now(),#{identity},#{status},#{userDes})")
    void addUserManager(User user);

    @Update("update user set username = #{username}, identity = #{identity}, userDes = #{userDes}, status = #{status} where id = #{id}")
    void updateUserInfo(User user);

    @Delete("delete from user where id = #{userId}")
    void deleteUserManager(Integer userId);
}
